#!/bin/bash
counter=$(ps -C nginx --no-heading|wc -l)
if [ "${counter}" = "0" ];then
    systemctl start nginx
    sleep 3
    counter=$(ps -C nginx --no-heading|wc -l)
    if [ "${counter}" = "0" ];then
        systemctl stop keepalived
    fi
fi
